package collection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class NewForDemo {
    public static void main(String[] args) {
        Collection<String> c = new ArrayList<String>();
        c.add("A");
        c.add("B");
        c.add("C");
        c.add("D");
        c.add("E");
        c.add("F");

        Iterator<String> it = c.iterator();
        while (it.hasNext()){
            System.out.println(it.next());
        }

        System.out.println("---------------------");

        for(String s : c){
            System.out.println(s);
        }

        System.out.println("---------------------");

        int[] a = new int[]{1,2,3,4,5,6,7};

        for(int s : a){
            System.out.println(s);
        }

    }
}
